#主函数
def main():
    str = input("请输入要统计的字符串：")
    countNumS(str)
    countPerNumS(str)
#统计字母个数和数字个数
def countNumS(str):
    map = {"数字":0,"字母":0}
    for s in str:
        if s.isdigit():
            map["数字"] = int(map.get("数字")) + 1
        if s.isalpha():
            map["字母"] = int(map.get("字母")) + 1
    print(map)

#统计各个字符与数字的数量
def countPerNumS(str):
    map = dict()
    for s in str:
        map[s] = map.get(s,0) + 1
    print(map)
main()
